#ifndef __I2C1_H_
#define __I2C1_H_

#include "stdbool.h"
#include "stm32f4xx_conf.h"

#define I2C1_SCL_GPIO_PORT	 	 GPIOB
#define I2C1_SCL_GPIO_CLK	 	 RCC_AHB1Periph_GPIOB
#define I2C1_SCL	     		 GPIO_Pin_6
#define I2C1_SCL_AF		   	 	 GPIO_AF_I2C1
#define I2C1_SCL_SOURCE	   		 GPIO_PinSource6

#define I2C1_SDA_GPIO_PORT	 	 GPIOB
#define I2C1_SDA_GPIO_CLK	     RCC_AHB1Periph_GPIOB
#define I2C1_SDA				 GPIO_Pin_7
#define I2C1_SDA_AF	   			 GPIO_AF_I2C1
#define I2C1_SDA_SOURCE	   		 GPIO_PinSource7
	




u8 I2C1_Init(u8 OwnAddress1);
static uint32_t getI2C1TimeLimit(void);
int32_t I2C1WriteByte(uint8_t devAdder, uint16_t regAdder, bool is16BitRegAdder, uint8_t num);
static int32_t I2C1WriteMoreByte(uint8_t devAdder, uint16_t startRegAdder, bool is16BitRegAdder,uint8_t *buf,uint8_t bufSize);
int32_t I2C1ReadByte(uint8_t devAdder, uint16_t regAdder, bool is16BitRegAdder, uint8_t *num);
int32_t I2C1ReadTwoByte(uint8_t devAdder, uint16_t startRegAdder, bool is16BitRegAdder, uint8_t *buf, bool isAllowOverPage);
static int32_t I2C1ReadMoreByte(uint8_t devAdder, uint16_t startRegAdder, bool is16BitRegAdder,uint8_t *buf,uint8_t bufSize);


#endif
